<template>
    <el-form-item label="年龄" prop="title">
        <div class="flexbox flexcenter checked_list">
            <el-radio label="1" v-model="createform.audience.age_null" @change="changeAgeNull">
                <div class="checked_item"><img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">不限</div>
            </el-radio>
            <el-checkbox-group v-model="createform.audience.age" @change="changeAgeHas">
                <el-checkbox label="AGE_BETWEEN_18_23">
                    <div class="checked_item"><img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">18-23</div>
                </el-checkbox>
                <el-checkbox label="AGE_BETWEEN_24_30">
                    <div class="checked_item"><img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">24-30</div>
                </el-checkbox>
                <el-checkbox label="AGE_BETWEEN_31_40">
                    <div class="checked_item"><img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">31-40</div>
                </el-checkbox>
                <el-checkbox label="AGE_BETWEEN_41_49">
                    <div class="checked_item"><img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">41-49</div>
                </el-checkbox>
                <el-checkbox label="AGE_ABOVE_50">
                    <div class="checked_item"><img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">50+</div>
                </el-checkbox>
            </el-checkbox-group>
        </div>
    </el-form-item>
</template>

<script>
export default {
    props:["createform"],
    name: "",
    data() {
        return {};
    },
    created() {},
    methods: {
        //年龄选择
        changeAgeNull() {
            this.createform.audience.age = [];
            this.sessionSave();
        },
        changeAgeHas() {
            if (this.createform.audience.age.length == 0) {
                this.createform.audience.age_null = "1";
            } else {
                this.createform.audience.age_null = "";
            }
            this.sessionSave();
        },

        sessionSave(){
            this.$emit("sessionSave")
        }
    },
    components: {},
};
</script>


<style scoped>
</style>

